From bd73cd02bbae9fa9f430ac1841a3ae10d6be0a89 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Sat, 13 Jan 2024 18:18:15 -0500 Subject: [PATCH] create and install package config file --- CMakeLists.txt | 11 +++++++++++ cmake/utf8proc-config.cmake.in | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 cmake/utf8proc-config.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 61da950..ff94dc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,17 @@ if (UTF8PROC_INSTALL) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libutf8proc.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") # Install CMake targets file. install(EXPORT utf8proc-targets FILE utf8proc-targets.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/utf8proc" NAMESPACE utf8proc::) + include (CMakePackageConfigHelpers) + configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/utf8proc-config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/utf8proc-config.cmake" + INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/utf8proc" + NO_SET_AND_CHECK_MACRO + ) + install (FILES + "${CMAKE_CURRENT_BINARY_DIR}/utf8proc-config.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/utf8proc" + ) endif() diff --git a/cmake/utf8proc-config.cmake.in b/cmake/utf8proc-config.cmake.in new file mode 100644 index 0000000..b9149bc --- /dev/null +++ b/cmake/utf8proc-config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ +include("${CMAKE_CURRENT_LIST_DIR}/utf8proc-targets.cmake") +# `check_required_components` is used to ensure consumer did not erroneously request components. +# No components are currently defined. +check_required_components(utf8proc) -- 2.39.5